﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class BackGround_Login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    protected void btn_Load_Click(object sender, EventArgs e)
    {
        String strUserName = ConfigurationManager.AppSettings["UserName"];
        String strUserPwd = ConfigurationManager.AppSettings["UserPwd"];
       
        if ((tb_UserName.Text == strUserName)
            &&  spbtzb.AuthenCtr.verifyMd5Hash(tb_UserPwd.Text, strUserPwd))
        {
            session_Logined = true;
            Response.Redirect("BgArticleList.aspx");
        }
        else
        {
            div_Show.InnerHtml = "用户名或密码错误";
        }
    }

    private Boolean session_Logined
    {
        set
        {
            Session["Logined"] = value;
        }
        get
        {
            return Session["Logined"] == null ? false : Convert.ToBoolean(Session["Logined"]); 
        }
    }

    //private String session_UserName
    //{
    //    set
    //    {
    //        Session["UserName"] = value;    
    //    }
    //    get
    //    {
    //        return Session["UserName"] == null ? "" : Convert.ToString(Session["UserName"]);
    //    }
    //}


    //private String session_UserPwd
    //{
    //    set
    //    {
    //        Session["UserPwd"] = value;
    //    }
    //    get
    //    {
    //        return Session["UserPwd"] == null ? "" : Convert.ToString(Session["UserPwd"]);
    //    }
    //}
}
